//
// Created by Lenovo on 2020/10/24.
//

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n,m,k;
        cin>>n>>m>>k;
        string s;
        for(int i = 1;i<=n-m;i++) s+='0';
        for(int i = 1;i<=m-1;i++) s+='1';
        string ans = s;
        int cnt = 1;
        do {
            if(ans!=s) cnt++;
            if(cnt==k)
            {
                cout<<"1"<<s<<endl;
                break;
            }
        }while (next_permutation(s.begin(),s.end()));
    }
}